import request from '@/config/axios'

// 师昌绪-总名额 VO
export interface ScxAmountVO {
  id: string // 总名额ID
  phd1st: number // 博士一等奖名额
  phd2nd: number // 博士二等奖名额
  phd3rd: number // 博士三等奖名额
  master1st: number // 硕士一等奖名额
  master2nd: number // 硕士二等奖名额
  isTemplate: boolean // 是否是奖项配置
  awardId: string // 评奖ID
  templateId: string // 奖项ID
  initialRules: string // 初评评审规则
  finalRules: string // 终评评审规则
  remark: string // 备注
}

// 师昌绪-总名额 API
export const ScxAmountApi = {
  // 查询师昌绪-总名额分页
  getScxAmountPage: async (params: any) => {
    return await request.get({ url: `/awards/scx-amount/page`, params })
  },

  // 查询师昌绪-总名额详情
  getScxAmount: async (id: string) => {
    return await request.get({ url: `/awards/scx-amount/get?id=` + id })
  },

  // 新增师昌绪-总名额
  createScxAmount: async (data: ScxAmountVO) => {
    return await request.post({ url: `/awards/scx-amount/create`, data })
  },

  // 修改师昌绪-总名额
  updateScxAmount: async (data: ScxAmountVO) => {
    return await request.put({ url: `/awards/scx-amount/update`, data })
  },

  // 删除师昌绪-总名额
  deleteScxAmount: async (id: string) => {
    return await request.delete({ url: `/awards/scx-amount/delete?id=` + id })
  },

  // 导出师昌绪-总名额 Excel
  exportScxAmount: async (params) => {
    return await request.download({ url: `/awards/scx-amount/export-excel`, params })
  },

  // 根据评奖ID获得师昌绪-总名额
  getScxAmountByAwardsId: async (awardsId: string) => {
    return await request.get({ url: `/awards/scx-amount/get-by-awards?awardsId=` + awardsId })
  }
}
